﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[ObterConstEquipasPorIDJogo]
			@IDJogos as numeric(18)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	select 
	JG.NomeUtilizador,
	JG.IDUser,
	EQ.NomeEquipa,
	CE.IDJogos,
	CE.Data
	from dbo.ConstituicaoEquipas CE
	inner join dbo.Utilizadores JG
	ON CE.IDJogador = JG.IDUser
	inner join dbo.Equipas EQ
	ON CE.IDEquipa = EQ.IDEquipa
	where CE.IDJogos = @IDJogos order by EQ.IDequipa

END